#!/usr/bin/env python

#-----Definition Section-------------
aTuple		= ( 'python', 'elephant', 'penguin' )
aList		= [ 'apple', 'mango', 'carrot', 'banana' ]
aSet		= { 'apple', 'orange', 'apple', 'pear', 'orange' }
bSet		= set ( aList )
aDictionary	= { 'Swaroop'	:	'swaroop@swaroopch.com',
				'Larry'		:	'larry@wall.org',
				'Matumoto'	:	'matz@ruby-lang.org',
				'Spammer'	:	'spammer@hotmail.com'
			  }

#-----Common Operation---------------
print ( len(aList) )
print ( len(aTuple) )
print ( len(aDictionary) )
print ( len(aSet) )

for item in aList:
	print(item, end=' ')
for item in aTuple:
	print(item, end=' ')
print ( aSet, bSet )
for name, address in aDictionary.items():
	print( 'Contact {0} at {1}'.format(name, address) )
	
print ( aList[0], aTuple[0], aDictionary['Swaroop'] )

del aList[0]
#del aTuple[0] #Tuple doesn't support del operation
del aDictionary['Swaroop']

#-----List Specific-----------------
aList.append('rice')
aList.sort()

#------Tuple Specific-----------------

#-----Dictionary Specific-----------
aDictionary['Guido'] = 'guido@python.org' #Add a key-value pair
if 'Guido' in aDictionary:
	print ( "Guido's address is", aDictionary['Guido'] )

#-----Set Specific-----------------
a = set('abracadabra')
b = set('alacazam')
print ( a, b )
print ( a - b )
print ( a | b )
print ( a & b )
print ( a ^ b )

